package com.wang.consumer.config;

import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;

@Configuration
public class RabbitConfig {

    // 配置 Jackson2JsonMessageConverter 用于消息的反序列化和序列化
    @Bean
    public MessageConverter jackson2MessageConverter() {
        return new Jackson2JsonMessageConverter();  // 使用 Jackson 进行 JSON 转换
    }

}
